import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

// 引入element-plus国际化组件
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

// 引入pinia持久化插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

// 引入初始化样式文件
import '@/styles/common.scss'

// 引入阿里巴巴字体图标库
import '@/assets/icon/iconfont.css'
import '@/assets/icon/iconfont.js'

const app = createApp(App)
const pinia = createPinia()

// 注册pinia持久化插件
pinia.use(piniaPluginPersistedstate)

// 配置element-plus国际化
app.use(ElementPlus, {
  locale: zhCn
})

app.use(pinia)
app.use(router)
app.mount('#app')
